23 #define foreach(x, v) for (typeof (v).begin() x = (v).begin(); x != (v).end(); ++x)
24 #define For(i, a, b) for (int i=(a); i<(b); ++i)
25 #define D(x) cout << #x " is " << x << endl
35 for (int i
=0; i
<w
; ++i
){
39 for (int i
=0; i
<n
; ++i
){
40 if (s
.find(prev
.substr(i
)) == 0){